package com.handc.springcloud.service;
import com.handc.springcloud.pojo.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;



@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-STUDENT",fallbackFactory = StudentClientServiceFallbackFactory.class)
public interface StudentClientService {

    @GetMapping("/stu/get/{id}")
    public Student queryById(@PathVariable("id") Long id);

    @GetMapping("/stu/list")
    public List<Student> queryAll();

    @PostMapping("/stu/add")
    public boolean addStudent(Student student);
}
